import request from '@neu/biz-core/utils/request'
const baseUrl = 'dcom/api/w/change/plan'

export const create = (data) => {
  console.log(data)
  return request({
    url: baseUrl,
    data,
    method: 'post'
  })
}

export const detail = (workOrderNum, taskId) => {
  return request({
    url: baseUrl + '/' + workOrderNum + '/' + taskId,
    method: 'get'
  })
}

export const downloadFile = (fsId) => {
  return request({
    url: baseUrl + '/download/' + fsId,
    method: 'get',
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/octet-stream'
    }
  })
}

export const importUrl = baseUrl + '/upload/attachment'

export const deleteAttachmentByFsId = (fsId, id) => {
  return request({
    url: baseUrl + '/delete/attachment/' + fsId + '/' + id,
    method: 'delete'
  })
}
